<template>
  <div>
    <h2 v-color="'blue'">child</h2>
    <h2>{{ msg }}</h2>
    <button @click="msg = '更新了'">更新</button>
  </div>
</template>

<script>
import { onMounted, onUnmounted, onUpdated, ref } from 'vue';
export default {
  created() {
    console.log('options created');
  },
  mounted() {
    console.log('options mounted');
  },
  updated() {
    console.log('options updated');
  },
  unmounted() {
    console.log('options unmounted');
  },
  setup() {
    const msg = ref('code');
    onMounted(() => {
      console.log('setup onMounted');
    });

    onUpdated(() => {
      console.log('setup onUpdated');
    });

    onUnmounted(() => {
      console.log('setup onUnmounted');
    });

    return {
      msg,
    };
  },
};
</script>

<style lang="scss" scoped></style>
